From 973bbebcc3a29a334bc3c8da2d816e39f81230a2 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Tue, 22 Aug 2006 14:59:16 +0100 Subject: [PATCH] Make add_to_bridge() always leave the device up even when it bails out due to the device already being present on the bridge. This makes the script more idempotent if run twice (e.g. from hotplug and udev), since the second time the device will be taken down and not brought up again, leaving the host without networking. Signed-off-by: Anil Madhavapeddy --- tools/examples/xen-network-common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/examples/xen-network-common.sh b/tools/examples/xen-network-common.sh index 37bdd77586..4c230a6402 100644 --- a/tools/examples/xen-network-common.sh +++ b/tools/examples/xen-network-common.sh @@ -143,6 +143,7 @@ add_to_bridge () { # Don't add $dev to $bridge if it's already on a bridge. if [ -e "/sys/class/net/${bridge}/brif/${dev}" ]; then + ip link set ${dev} up || true return fi brctl addif ${bridge} ${dev} -- 2.30.2